import request from '@/utils/request'

const prePath = '/quality'

//获取所有菜单
export function getAdverseEventCustomizePage(data) {
  return request({
    url: prePath + '/adverseEvent/customizeList/page',
    method: 'post',
    data,
  })
}

export function getAdverseEventCustomizeGroups(data) {
  return request({
    url: prePath + '/adverseEvent/customizeGroups',
    method: 'post',
    data,
  })
}

export function getAdverseEventAll(data) {
  return request({
    url: prePath + '/adverseEvent/customizeList/all',
    method: 'post',
    data,
  })
}
//删除不良事件
export function removeAdverseEvent(data) {
  return request({
    url: prePath + '/adverseEvent',
    method: 'delete',
    data,
  })
}
//提交不良事件
export function submitAdverseEvent(data) {
  return request({
    url: prePath + '/adverseEvent/submit',
    method: 'post',
    data,
  })
}
//批准不良事件
export function approveAdverseEvent(data) {
  return request({
    url: prePath + '/adverseEvent/approved',
    method: 'post',
    data,
  })
}
//驳回不良事件
export function rejectAdverseEvent(data) {
  return request({
    url: prePath + '/adverseEvent/reject',
    method: 'post',
    data,
  })
}
//拒绝不良事件
export function refuseAdverseEvent(data) {
  return request({
    url: prePath + '/adverseEvent/refuse',
    method: 'post',
    data,
  })
}
// 不良事件-批量撤回
export function recallAdverseEvent(data) {
  return request({
    url: prePath + '/adverseEvent/revoke',
    method: 'post',
    data,
  })
}
// 不良事件-批量销审
export function salesReviewAdverseEvent(data) {
  return request({
    url: prePath + '/adverseEvent/cancelCheck',
    method: 'post',
    data,
  })
}
//获取不良事件
export function getAdverseEvent(id) {
  return request({
    url: prePath + '/adverseEvent/' + id,
    method: 'get',
  })
}
//新增不良事件
export function createAdverseEvent(data) {
  return request({
    url: prePath + '/adverseEvent',
    method: 'post',
    data,
  })
}
export function createAdverseEventAndSave(data) {
  return request({
    url: prePath + '/adverseEvent/saveAndSubmit',
    method: 'post',
    data,
  })
}
//更新不良事件
export function updateAdverseEvent(data) {
  return request({
    url: prePath + '/adverseEvent',
    method: 'put',
    data,
  })
}
//根据ID获取不良事件
export function getAdverseEventById(id) {
  return request({
    url: prePath + '/adverseEvent/' + id,
    method: 'get',
  })
}
//打印不良事件详情
//资产转移详情打印
export function printAdverseEvent(data) {
  return request({
    url: prePath + '/adverseEvent/printOrder',
    method: 'post',
    data,
  })
}
export function createInspectionRecord(data) {
  return request({
    url: prePath + '/inspectionRecord',
    method: 'post',
    data,
  })
}
export function updateInspectionRecord(data) {
  return request({
    url: prePath + '/inspectionRecord',
    method: 'put',
    data,
  })
}
export function getInspectionRecordById(id) {
  return request({
    url: prePath + '/inspectionRecord/' + id,
    method: 'get',
  })
}
export function getInspectionRecordPage(params) {
  return request({
    url: prePath + '/inspectionRecord/page',
    method: 'get',
    params,
  })
}
export function deleteInspectionRecord(data) {
  return request({
    url: prePath + '/inspectionRecord',
    method: 'delete',
    data,
  })
}
export function excelListInspectionRecord(data) {
  return request({
    url: prePath + `/inspectionRecord/excel`,
    method: 'post',
    data,
    responseType: 'blob',
  })
}
export function createOperationTrainingRecord(data) {
  return request({
    url: prePath + '/operationTrainingRecord',
    method: 'post',
    data,
  })
}
export function updateOperationTrainingRecord(data) {
  return request({
    url: prePath + '/operationTrainingRecord',
    method: 'put',
    data,
  })
}
export function getOperationTrainingRecordById(id) {
  return request({
    url: prePath + '/operationTrainingRecord/' + id,
    method: 'get',
  })
}
export function getOperationTrainingRecordPage(params) {
  return request({
    url: prePath + '/operationTrainingRecord/page',
    method: 'get',
    params,
  })
}
export function deleteOperationTrainingRecord(data) {
  return request({
    url: prePath + '/operationTrainingRecord',
    method: 'delete',
    data,
  })
}
export function excelListOperationTrainingRecord(data) {
  return request({
    url: prePath + `/operationTrainingRecord/excel`,
    method: 'post',
    data,
    responseType: 'blob',
  })
}
// 计量器具任务 列表
export function getMeasuringVerificationTaskPage(data) {
  return request({
    url: prePath + '/measuringVerificationTask/customizeList/page',
    method: 'post',
    data,
  })
}
// 计量检定记录 详情
export function getMeasuringVerificationTaskById(id) {
  return request({
    url: prePath + '/measuringVerificationTask/' + id,
    method: 'get',
  })
}
// 计量器具任务 取消
export function cancelMeasuringVerificationTask(data) {
  return request({
    url: prePath + '/measuringVerificationTask/cancel',
    method: 'post',
    data,
  })
}
// 计量检定记录 列表
export function getMeasuringVerificationRecordPage(data) {
  return request({
    url: prePath + '/measuringVerificationRecord/customizeList/page',
    method: 'post',
    data,
  })
}
// 计量检定记录 列表所有
export function getMeasuringVerificationRecordPageAll(data) {
  return request({
    url: prePath + '/measuringVerificationRecord/customizeList/all',
    method: 'post',
    data,
  })
}
// 计量检定记录 新增
export function createMeasuringVerificationRecord(data) {
  return request({
    url: prePath + '/measuringVerificationRecord',
    method: 'post',
    data,
  })
}
// 计量检定记录 批量录入
export function createMeasuringVerificationRecordBatchInsert(data) {
  return request({
    url: prePath + '/measuringVerificationRecord/batchInsert',
    method: 'post',
    data,
  })
}
// 计量检定记录 修改
export function updateMeasuringVerificationRecord(data) {
  return request({
    url: prePath + '/measuringVerificationRecord',
    method: 'put',
    data,
  })
}
// 计量检定记录 详情
export function getMeasuringVerificationRecordById(id) {
  return request({
    url: prePath + '/measuringVerificationRecord/' + id,
    method: 'get',
  })
}
// 计量检定记录 删除
export function deleteMeasuringVerificationRecord(data) {
  return request({
    url: prePath + '/measuringVerificationRecord',
    method: 'delete',
    data,
  })
}